#ifndef __HTTP_CMD_PROCESS__H__
#define __HTTP_CMD_PROCESS__H__

#include <mutex>
#include <string>
#include "json.h"
#include <functional>
#include "Network/Socket.h"

using namespace std;
using namespace Fdt;
namespace Media{
	class HttpCmdProcess
	{
	public:
		static HttpCmdProcess* instance();

		bool getDeviceCapacity(Json::Value &table);

		bool getStreamType(Json::Value &table);

		bool setCurtainLayout(const Json::Value &table);

		bool getCurtainLayout(Json::Value &table);

		bool setPlayStrategy(const Json::Value &table);

		bool playDefaultCurtain();

		bool SetDeviceShareStatus(const Json::Value &table);

		bool fileVerify(string filename, const char *md5);

		bool streamWrite(string filename, const void *buffer, size_t size);

		bool fileStreamReset(string filename, string Type);

		bool scanAP(Json::Value &apList);

		bool ConnectWifi(const Json::Value table);
		
		bool openApService(const Json::Value table);
		
		bool getOutputInterface(Json::Value &table);	

		bool getMirrorPinCode(string &pinCode);

		bool SetNetwork(Json::Value table);

		bool GetNetwork(Json::Value &table);

		bool GetFileInfo(Json::Value table, string &filename, unsigned int &size, string &md5);
		
		bool CloudUploadStream(Json::Value table, function<bool(string file, string url, function<void(const SockException &ex)> cb)> callback);

		int getCloudUpMark();
	
		bool setCloudUpMark(int mark);
		
		bool GetDeviceList(Json::Value &table);

		bool Subscribe(function<bool(Json::Value table)> cb);
		
	private:
		HttpCmdProcess();
		~HttpCmdProcess();

	private:
		static HttpCmdProcess*			            sm_objectIns;

		static std::mutex 			                sm_insMutex;

	};
}//namespace Media

#endif
